package com.example.demo.serviceImpl;

import com.example.demo.dao.ProductDao;
import com.example.demo.entity.ResultMsg;
import com.example.demo.service.ProductService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class ProductServiceImpl implements ProductService {
    @Resource
    private ProductDao productDao;

    @Override
    public ResultMsg detail(Long productId) {
        return ResultMsg.successfulData(productDao.selectByPrimaryId(productId));
    }

    @Override
    public ResultMsg updateStore(Long productId, int amount) {
        productDao.updateStore(productId, amount);
        return ResultMsg.ok();
    }
}
